<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>登陆</title>
<%@ include file="/WEB-INF/views/include.inc.jsp"%>
<link rel="stylesheet" href="${contextPath }/styles/bootstrapvalidator/css/bootstrapValidator.css"/>
<script src="${contextPath }/styles/bootstrapvalidator/js/bootstrapValidator.js"></script>
<script src="${contextPath }/styles/bootstrapvalidator/js/language/zh_CN.js"></script>
</head>
<body class="page-login">
<div class="container">
  <form method="post" action="${contextPath }/login" class="form-login">
    <h2 class="form-login-heading"></h2>
    <div class="form-group">
      <input type="text" name="username" class="form-control" placeholder="用户名" autofocus
      		data-bv-notempty data-bv-notempty-message="用户名不能为空" />
      <span class="glyphicon icon-name" aria-hidden="true"></span>
    </div>
    <div class="form-group">
      <input type="password" name="password" class="form-control" placeholder="密&nbsp;&nbsp;&nbsp;码"
      		data-bv-notempty data-bv-notempty-message="密码不能为空" />
      <span class="glyphicon icon-pwd" aria-hidden="true"></span>
    </div>
    <div class="form-group">
      <button class="btn btn btn-info btn-block btn-submit" type="submit">登&nbsp;&nbsp;录</button>
    </div>
    <p class="addition">
      <a href="${contextPath }/index/registered" class="pull-left">立即注册</a>
      <a href="${contextPath }/index" class="pull-right">返回首页</a>
    </p>
  </form>
</div>
</body>
<script>
$(function() {
	if ("${msg}".length > 0) {
		error("${msg}");
	}
	$('form').bootstrapValidator({
		message: 'This value is not valid',
		feedbackIcons: {
			valid: 'glyphicon glyphicon-ok',
			invalid: 'glyphicon glyphicon-remove',
			validating: 'glyphicon glyphicon-refresh'
		}
	});
});
</script>
</html>
